const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');

module.exports = {
  packagerConfig: {
    asar: true,
    icon: './icons/logo512',
    osxSign: {
      identity: 'Developer ID Application: BIG Learning Limited (TNK39GJ23C)'
    },
    osxNotarize: {
      tool: 'notarytool',
      appleId: "alex@bigread.ai",
      appleIdPassword: "okzy-xbqt-sfpx-jbhk",
      teamId: "TNK39GJ23C"
    }
    // osxNotarize: {
    //   tool: 'notarytool',
    //   appleId: "2775409354@qq.com",
    //   appleIdPassword: "hzzu-bvix-bdiv-gmcn",
    //   teamId: "HHYDRW3XLC"
    // }
  },
  rebuildConfig: {

  },
  makers: [
    {
      name: '@electron-forge/maker-dmg',
      config: {
        background: './assets/dmg-background.png',
        format: 'ULFO'
      }
    },
    // {
    //   name: '@electron-forge/maker-wix',
    //   config: {
    //     language: 1033,
    //     manufacturer: 'My Awesome Company'
    //   }
    // }
  ],
  plugins: [
    {
      name: '@electron-forge/plugin-auto-unpack-natives',
      config: {},
    },
    // Fuses are used to enable/disable various Electron functionality
    // at package time, before code signing the application
    new FusesPlugin({
      version: FuseVersion.V1,
      [FuseV1Options.RunAsNode]: false,
      [FuseV1Options.EnableCookieEncryption]: true,
      [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
      [FuseV1Options.EnableNodeCliInspectArguments]: false,
      [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
      [FuseV1Options.OnlyLoadAppFromAsar]: true,
    }),
  ],
};
